glarea: Drop the dispose vfunc
authorMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:49:52 +0000 (19:49 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 18 Jan 2018 00:49:52 +0000 (19:49 -0500)
This was causing us to leak, in the following scenario:
1) gtk_widget_destroy is called on a GL area
2) dispose is run and clears the context
3) the GL area is unrealized, but the context is already cleared,
   so we leak all the GL buffers

gtk/gtkglarea.c

index 22348ee01cc227a1d3bba67cdd69d681d2f21e90..f6254cf8a4cefb5f1734891421fa325110905265 100644 (file)
@@ -201,17 +201,6 @@ static guint area_signals[LAST_SIGNAL] = { 0, };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkGLArea, gtk_gl_area, GTK_TYPE_WIDGET)
 
-static void
-gtk_gl_area_dispose (GObject *gobject)
-{
-  GtkGLArea *area = GTK_GL_AREA (gobject);
-  GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
-
-  g_clear_object (&priv->context);
-
-  G_OBJECT_CLASS (gtk_gl_area_parent_class)->dispose (gobject);
-}
-
 static void
 gtk_gl_area_set_property (GObject      *gobject,
                           guint         prop_id,
@@ -891,7 +880,6 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
 
   gobject_class->set_property = gtk_gl_area_set_property;
   gobject_class->get_property = gtk_gl_area_get_property;
-  gobject_class->dispose = gtk_gl_area_dispose;
   gobject_class->notify = gtk_gl_area_notify;
 
   g_object_class_install_properties (gobject_class, LAST_PROP, obj_props);